package com.link2room.rodimus.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * Created by LN on 2018/1/3
 */
@Entity
@DynamicInsert
@Table(name = "sign_in_reissue_mapping")
public class SignInReissueMappingEntity extends BaseEntity {
    private String ruleBaseCode;
    private String reissueCode;

    private String type;


    @Basic
    @Column(name = "rule_base_code")
    public String getRuleBaseCode() {
        return ruleBaseCode;
    }

    public void setRuleBaseCode(String ruleBaseCode) {
        this.ruleBaseCode = ruleBaseCode;
    }

    @Basic
    @Column(name = "reissue_code")
    public String getReissueCode() {
        return reissueCode;
    }

    public void setReissueCode(String reissueCode) {
        this.reissueCode = reissueCode;
    }

    @Basic
    @Column(name = "type")
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SignInReissueMappingEntity that = (SignInReissueMappingEntity) o;

        if (ruleBaseCode != null ? !ruleBaseCode.equals(that.ruleBaseCode) : that.ruleBaseCode != null) return false;
        if (reissueCode != null ? !reissueCode.equals(that.reissueCode) : that.reissueCode != null) return false;
        return type != null ? type.equals(that.type) : that.type == null;
    }

    @Override
    public int hashCode() {
        int result = ruleBaseCode != null ? ruleBaseCode.hashCode() : 0;
        result = 31 * result + (reissueCode != null ? reissueCode.hashCode() : 0);
        result = 31 * result + (type != null ? type.hashCode() : 0);
        return result;
    }

    @Override
    public String toString() {
        return "SignInReissueMappingEntity{" +
                "ruleBaseCode='" + ruleBaseCode + '\'' +
                ", reissueCode='" + reissueCode + '\'' +
                ", type='" + type + '\'' +
                '}';
    }
}
